//和内存分配有关的函数

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "mymemory.h"

MyMemory *MyMemory::instance_ = NULL;

MyMemory::MyMemory(){}
MyMemory::~MyMemory(){}

//分配内存
void *MyMemory::AllocMemory(int mem_count, bool if_mem_set) {
	void *tmp_data = (void *)new char[mem_count];
	if(if_mem_set) {
		memset(tmp_data, 0, mem_count);
	}
	return tmp_data;
}

//内存释放函数
void MyMemory::FreeMemory(void *point) {
	delete [] ((char *)point);
}
